import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Login from '@/pages/Login'
import Login2 from '@/pages/Login_2'
import Index from '@/pages/Index'

const router = new VueRouter({
    mode:"hash",
    routes: [
        {
            path:"/",
            redirect:"/login"
        },
        {
            path:"/login",
            name:"login",
            component:Login
        },
        {
            path:"/login/email",
            name:"email-login",
            component:Login2
        },
        {
            path:"/index",
            name:"index",
            component:Index
        }
    ]
})

router.beforeEach((to,from,next)=>{
    console.log(from)
    next()
})


export default router